package net.lee.shiro.demo.entity.usersystem;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "menu", schema = "admin_system", catalog = "")
public class MenuEntity {
    private long menuId;
    private String menuName;
    private String menuUrl;
    private Long parentMenuId;
    private Integer isShow;
    private Integer menuStatus;
    private Long moduleId;

    @Id
    @Column(name = "menu_id")
    public long getMenuId() {
        return menuId;
    }

    public void setMenuId(long menuId) {
        this.menuId = menuId;
    }

    @Basic
    @Column(name = "menu_name")
    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    @Basic
    @Column(name = "menu_url")
    public String getMenuUrl() {
        return menuUrl;
    }

    public void setMenuUrl(String menuUrl) {
        this.menuUrl = menuUrl;
    }

    @Basic
    @Column(name = "parent_menu_id")
    public Long getParentMenuId() {
        return parentMenuId;
    }

    public void setParentMenuId(Long parentMenuId) {
        this.parentMenuId = parentMenuId;
    }

    @Basic
    @Column(name = "is_show")
    public Integer getIsShow() {
        return isShow;
    }

    public void setIsShow(Integer isShow) {
        this.isShow = isShow;
    }

    @Basic
    @Column(name = "menu_status")
    public Integer getMenuStatus() {
        return menuStatus;
    }

    public void setMenuStatus(Integer menuStatus) {
        this.menuStatus = menuStatus;
    }

    @Basic
    @Column(name = "module_id")
    public Long getModuleId() {
        return moduleId;
    }

    public void setModuleId(Long moduleId) {
        this.moduleId = moduleId;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        MenuEntity that = (MenuEntity) o;
        return menuId == that.menuId &&
                Objects.equals(menuName, that.menuName) &&
                Objects.equals(menuUrl, that.menuUrl) &&
                Objects.equals(parentMenuId, that.parentMenuId) &&
                Objects.equals(isShow, that.isShow) &&
                Objects.equals(menuStatus, that.menuStatus) &&
                Objects.equals(moduleId, that.moduleId);
    }

    @Override
    public int hashCode() {

        return Objects.hash(menuId, menuName, menuUrl, parentMenuId, isShow, menuStatus, moduleId);
    }
}
